Xbasic

Sql_get_Values Function

Syntax

c Values = sql_get_values(* conn ,C table ,C filter ,C result_Expression [,L flagDistinct [,N limit [,L flagDescendingOrder [,* args ]]]])

Arguments

Values

A CRLF delimited string of data from the remote table or query. CRLFs in the data are encoded as '\cr\lf'.

conn

An explicit AlphaDAO connection string, or a named connection string. (e.g. ::name::myconnectionstring), or a pointer to an open connection.

table

The name of the table in the remote database from which to return data.

filter

A filter expression to determine which records in the remote table to find. The filter expression must use SQL syntax and must use portable AlphaDAO functions. For example, strings must be single quoted, the AND, OR and NOT operators are not surrounded by periods. The filter expression can use arguments. For example, customerid = :whatcustomerid. If table_or_sql_statement is a SQL SELECT then filter is meaningless and must be set to a null string.

result_Expression

A expression to determine what values gets returned. The expression can be as simple as a single column name in the remote table, or it can be a complex expression. The expression must be written using portable AlphaDAO syntax. r

flagDistinct

Logical. Default for this if .f.. Specify if only unique values should be returned.

limit

Numeric. Default for this is 1,000. Specify the maximum number of values to return.

flagDescendingOrder

Logical. Default for this is .f.. Specify if values should be returned in descending order.

args

If the filter expression includes arguments, you must supply argument values using a SQL::arguments object.

Description

Returns a CRLF delimited string with data from a table in a remote database using AlphaDAO. Connection can be explicit, or a named connection (e.g. ::name::myconnection).